<?php
  class SCAction extends Action{
   public function _initialize(){
   C('','BY_USER_SET_CONFIG');
   if(C('Installer_setup_n')=='finish'){
   		$this->redirect('Finish/finish');
   }
   }


  Public function D_add($tb,$to,$success,$error){
	 $Form=D($tb);
	if($Form->create()) { 
        $result =   $Form->add();
        if($result) {
           $this->success((isset($success)?$success:'操作成功！'),$to);
        }else{
            $this->error((isset($error)?$error:'写入错误！'));
        }
		return $result;
    }else{
        $this->error($Form->getError());
    }
  }
    public function D_update($tb,$success,$error){
	 $Form=D($tb);
	if($Form->create()) {
        $result =   $Form->save();
        if($result) {
            $this->success((isset($success)?$success:'操作成功！'));
        }else{
            $this->error((isset($error)?$error:'写入错误！'));
        }
    }else{
        $this->error($Form->getError());
    }
  }
  }
?>